<?php

// $Id$


class Mail_Attachment extends Tangra_Class {
	private $file;
	private $name;
	private $type = 'application/octet-stream';
	private $encoding = 'base64';
	private $content_disposition = 'attachment';

	function __construct($file, $name, $type = 'application/octet-stream', $encoding = 'base64', $content_disposition = 'attachment') {
		$this->set_file($file);
		$this->set_name($name);
		$this->set_type($type);
	}


	public function set_file($file) {
		if (file_exists($file)) {
			$this->file = $file;
		} else {
			throw new Tangra_Module_Exception('Cannot find file: '.$file);
		}
	}


	public function get_file() {
		return $this->file;
	}


	public function set_name($name) {
		$this->name = $name;
	}


	public function get_name() {
		return $this->name;
	}


	public function set_type($type) {
		$this->type = $type;
	}


	public function get_type() {
		return $this->type;
	}


	public function set_encoding($encoding) {
		$this->encoding = $encoding;
	}


	public function get_encoding() {
		return $this->encoding;
	}


	public function set_content_disposition($content_disposition) {
		$this->content_disposition = $content_disposition;
	}


	public function get_content_disposition() {
		return $this->content_disposition;
	}
}